<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>酒店查询列表</title>
		<link href="../mui/css/mui.min.css" rel="stylesheet" />
		<link href="./css/mui.min.css" rel="stylesheet" />
		<link href="../mui/css/mui.indexedlist.css" rel="stylesheet" />
		<link href="../styles/default.css" rel="stylesheet" />
		<style>
			.mui-bar-nav~.mui-content {
				padding-top: 3.2rem;
			}
			
			.mui-bar {
				height: 3.2rem;
			}
			
			.mui-content {
				margin-top: 2.2rem;
				margin-bottom: 3.3rem;
			}
			
			.mui-content>.mui-table-view:first-child {
				margin-top: 0;
			}
			
			.mui-content li:last-child {
				padding-bottom: 0.75rem;
			}
			
			.hotel-header {
				font-size: 0.6rem;
				color: #999;
			}
			
			.hotel-header .mui-icon {
				background-color: transparent;
			}
			
			.mui-table-view-cell {
				padding: 0.375rem 0.6rem;
			}
			
			.mui-table-view-cell:first-child {
				padding-top: 0.6rem;
			}
			
			.mui-table-view-cell:last-child {
				padding-bottom: 0.6rem;
			}
			
			.mui-bar {
				display: flex;
				align-items: center;
				justify-content: space-between;
				padding-left: 0.6rem;
			}
			
			.mui-navigate-right:after,
			.mui-push-right:after {
				right: inherit;
			}
			
			.mui-bar a {
				position: relative;
			}
			
			.mui-indexed-list {
				width: 78%;
				border-radius: 0.25rem;
				border: none;
			}
			
			.mui-indexed-list-search {
				border: none;
			}
			
			.mui-bar input[type=search] {
				margin: 0;
			}
			
			.mui-bar .mui-icon {
				padding: 0;
			}
			
			.mui-search .mui-placeholder {
				height: 1.5rem;
				font-size: 0.5rem;
				line-height: 1.5rem;
			}
			
			.mui-search .mui-placeholder .mui-icon {
				font-size: 16px;
				margin: 0;
			}
			
			.mui-bar-nav.mui-bar .mui-icon {
				padding-right: 5px;
				padding-left: 5px;
			}
			
			.hotel-list {
				display: flex;
				flex-direction: row;
				align-items: center;
			}
			
			.hotel-list-img {
				width: 3.75rem;
				height: 3.75rem;
				position: relative;
				margin-right: 0.45rem;
			}
			
			.hotel-list-img img {
				width: 3.75rem;
				height: 3.75rem;
				vertical-align: middle;
				border-radius: 4px;
			}
			
			.hot {
				position: absolute;
				top: -0.45rem;
				right: -0.3rem;
				width: 1.5rem;
				height: 0.9rem;
				line-height: 0.9rem;
				font-size: 0.6rem;
				text-align: center;
				color: #fff;
				background-color: #e61874;
				border-radius: 0.45rem;
			}
			
			.hotel-list-info {
				display: flex;
				flex-direction: column;
				width: 57%;
			}
			
			.info-title {
				font-size: 0.8rem;
				color: #333;
				overflow: hidden;
				text-overflow: ellipsis;
				white-space: nowrap;
				-webkit-line-clamp: 1;
			}
			
			.info-font-12 {
				font-size: 0.6rem;
				color: #666;
			}
			
			.summary {
				color: #e61874;
				padding: 0.45rem 0;
				overflow: hidden;
				text-overflow: ellipsis;
				white-space: nowrap;
				-webkit-line-clamp: 1;
			}
			
			.score {
				padding-bottom: 0.3rem;
			}
			
			.address {
				overflow: hidden;
				text-overflow: ellipsis;
				white-space: nowrap;
				-webkit-line-clamp: 1;
			}
			
			.hotel-list-price {
				display: flex;
				flex-direction: column;
				align-items: flex-end;
				flex: 1;
			}
			
			.hotel-list-price span {
				display: flex;
				align-items: flex-end;
				color: #e61874;
			}
			
			.hotel-list-price .start {
				font-size: 0.6rem;
				color: #666;
			}
			
			.hotel-list-price img {
				width: 0.8rem;
			}
			
			.info-content-top {
				font-size: 0.75rem;
			}
			
			.info-content-bottom span {
				font-size: 0.6rem;
				color: #666;
			}
			
			.info-content-bottom span.right30 {
				position: absolute;
				right: 1.5rem;
			}
			
			.mui-table-view:before,
			.mui-table-view:after {
				background-color: transparent;
			}
			
			.mui-table-view-cell:after {
				left: 0;
				background-color: transparent;
			}
			
			.mui-input-row {
				font-size: 0.7rem;
				background-color: #fff;
				padding: 0 0.6rem;
			}
			
			.hotel-fixed-area {
				display: flex;
				align-items: center;
				justify-content: flex-end;
			}
			
			.hotel-fixed-area img {
				width: 50%;
			}
			
			.view {
				position: fixed;
				bottom: 2.4rem;
				right: 0.6rem;
				background-color: #fff;
				width: 2.4rem;
				height: 2.4rem;
				display: flex;
				flex-direction: column;
				align-items: center;
				justify-content: center;
				border: 1px solid #e61874;
				border-radius: 50%;
			}
			
			.view img {
				width: 0.75rem;
			}
			
			.view span {
				font-size: 0.5rem;
				color: #e61874;
			}
			/* 筛选--开始 */
			
			.hotel-footer {
				position: absolute;
				border: none;
				background-color: #f0f0f0;
				top: 3.2rem;
				height: 45px;
			}
			
			.hotel-footer-menu {
				display: flex;
				text-align: center;
			}
			
			.hotel-footer-menu li {
				font-size: 0.6rem;
				height: 45px;
				line-height: 45px;
				padding: 0;
			}
			
			.option-item {
				position: relative;
				color: #999;
			}
			
			.option:first-child .option-item:after {
				position: absolute;
				content: '';
				width: 4px;
				height: 6px;
				right: -12px;
				bottom: 4px;
				background-image: url(../styles/images/list/icon_direction_selected.png@2x.png);
				background-size: 4px 6px;
			}
			
			.option-item:after {
				position: absolute;
				content: '';
				width: 4px;
				height: 6px;
				right: -12px;
				bottom: 4px;
				background-image: url(../styles/images/list/icon_direction_selected_gray.png@2x.png);
				background-size: 4px 6px;
			}
			
			.option-item.active {
				
				color: #e61874;
			}
			
			.option-item.active:after {
				position: absolute;
				content: '';
				width: 6px;
				height: 4px;
				right: -12px;
				bottom: 4px;
				background-image: url(../styles/images/list/icon_direction_down.png@2x.png);
				background-size: 6px 4px;
			}
			
			.recommend-box,
			.price-box,
			.filter-box {
				position: absolute;
				top: 45px;
				left: 0;
				width: 100%;
				max-height: 300px;
				overflow-y: auto;
				padding: 1.2rem 0.6rem 0.15rem 0.6rem;
				background-color: #fff;
			}
			/* 推荐排序--开始 */
			
			.recommend-item {
				padding-bottom: 1.05rem;
			}
			
			.recommend-item:last-child {
				padding-bottom: 0.6rem;
			}
			
			.recommend-item span {
				font-size: 0.7rem;
				color: #666;
				padding-left: 1.05rem;
			}
			
			.recommend-item span.active {
				position: relative;
				color: #e61374;
			}
			
			.recommend-item span.active:before {
				display: inline-block;
				position: absolute;
				left: 0;
				top: 0.2rem;
				width: 0.6rem;
				height: 0.4rem;
				content: '';
				background-image: url(../styles/images/list/icon_ensure_nor.png@2x.png);
				background-size: 0.6rem 0.4rem;
			}
			/* 推荐排序--结束 */
			/* 刷选项--开始 */
			.mui-input-row.mui-input-range {
				padding-right: 0.6rem;
				padding-bottom: 0.9rem;
			}
			
			.list-box:last-child .filter-tag {
				margin-bottom: 0;
			}
			
			.price-box p,
			.filter-box p {
				display: inline-block;
				width: 100%;
				font-size: 0.6rem;
				color: #999;
				padding-left: 0.45rem;
				margin-bottom: 0;
			}
			
			.price-tag,
			.filter-tag {
				height: 1.5rem;
				margin: 0.6rem 0 0.75rem;
			}
			
			.price-tag li,
			.filter-tag li {
				float: left;
				height: 1.5rem;
				line-height: 1.5rem;
				font-size: 0.6rem;
				color: #333;
				text-align: center;
				border: 1px solid #999;
				border-radius: 0.725rem;
				margin-right: 0.45rem;
				margin-bottom: 0.6rem;
				padding: 0 0.3rem;
			}
			
			.filter-tag li {
				min-width: 22.5%;
			}
			
			.filter-tag li:nth-child(4n) {
				margin-right: 0;
			}
			
			.boxview {
				background: rgba(0, 0, 0, 1);
				height: 100%;
				width: 100%;
			}
			
			.price-tag li {
				min-width: 30%;
				margin-right: 0.65rem;
			}
			
			.price-tag li:nth-child(3n) {
				margin-right: 0;
			}
			
			li.default {
				color: #E61874;
				border-color: #e61874 ;
			}
			/* 筛选项--结束 */
			/* 筛选--结束 */
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav hotel-header">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<div id='list' class="mui-indexed-list">
				<div class="mui-indexed-list-search mui-input-row mui-search">
					<input type="search" class="mui-input-clear mui-indexed-list-search-input" placeholder="酒店名、地名">
				</div>
			</div>
			<a class="mui-icon mui-pull-right" style="font-size: 0.8rem;" data-url="./maps_map.html">
				<img width="48px" style="vertical-align: middle;" src="../styles/images/list/icon_map_white_nor.png@2x.png">
			</a>
			<footer class="hotel-footer">
				<ul class="hotel-footer-menu hotel-footer-menu-c4" id="optionul">
					<li class="option" id="recommend" data-id="1">
						<a class="option-item" href="#" style="color: #e61874;">推荐排序</a>
					</li>
					<li class="option" id="price" data-id="2">
						<a class="option-item" href="#">价格/星级</a>
					</li>
					<li class="option" id="position" data-id="3">
						<a class="option-item active" href="#">位置区域</a>
					</li>
					<li class="option" id="filter" data-id="4">
						<a class="option-item" href="#">筛选</a>
					</li>
				</ul>
				<div class="recommend-box" style="display: none;">
					<ul>
						<li class="recommend-item">
							<span>推荐排序</span>
						</li>
						<li class="recommend-item">
							<span class="active">距离优先</span>
						</li>
						<li class="recommend-item">
							<span>低价优先</span>
						</li>
						<li class="recommend-item">
							<span>高价优先</span>
						</li>
						<li class="recommend-item">
							<span class="">好评优先</span>
						</li>
					</ul>
				</div>
				<div class="price-box" style="display: none;">
					<div class="list-box">
						<p>星级筛选</p>
						<ul class="price-tag">
							<li>经济型</li>
							<li>二星</li>
							<li>三星/舒适</li>
							<li>四星/高档</li>
							<li>五星/豪华</li>
							<li class="default">不限</li>
						</ul>
					</div>
					<div class="list-box">
						<p>价格筛选：<span id='block-range-val'>0</span></p>
						<div class="mui-input-row mui-input-range">
							<input type="range" id='block-range' value="0" min="0" max="1000">
						</div>
					</div>
				</div>
				<div class="position-box" style="display: none;">
				</div>
				<div class="filter-box" style="display: none;">
					<div>
						<div class="list-box">
							<p>特色专题</p>
							<ul class="filter-tag">
								<li>火辣</li>
								<li>烂漫</li>
								<li>纯情</li>
								<li>情趣</li>
							</ul>
						</div>
						<div class="list-box">
							<p>评分</p>
							<ul class="filter-tag">
								<li>4.5分以上</li>
								<li>4分以上</li>
								<li>3.5分以上</li>
								<li>3分以上</li>
							</ul>
						</div>
						<div class="list-box">
							<p>设施服务</p>
							<ul class="filter-tag">
								<li>情趣用品</li>
								<li>免费wifi</li>
								<li>停车场</li>
							</ul>
						</div>
						<div class="list-box">
							<p>舒适性</p>
							<ul class="filter-tag">
								<li>锦江之星品尚酒店</li>
								<li>一品公寓</li>
							</ul>
						</div>
						<div class="list-box">
							<p>高档型</p>
							<ul class="filter-tag">
								<li>新桃园</li>
							</ul>
						</div>
						<div class="list-box">
							<p>闪住</p>
							<ul class="filter-tag">
								<li>闪住</li>
							</ul>
						</div>
					</div>
				</div>
			</footer>
		</header>
		<script src="../mui/js/mui.min.js"></script>
		<script src="../libs/ems.js" data-main='./city.js'></script>
		<script type="text/javascript">
			mui.init({
				swipeBack: true //启用右滑关闭功能
			});
			//监听input事件，获取range的value值，也可以直接element.value获取该range的值
			var rangeList = document.querySelectorAll('input[type="range"]');
			for(var i = 0, len = rangeList.length; i < len; i++) {
				rangeList[i].addEventListener('input', function() {
					if(this.id.indexOf('field') >= 0) {
						document.getElementById(this.id + '-input').value = this.value;
					} else {
						document.getElementById(this.id + '-val').innerHTML = this.value;
					}

				});
			}
			
			var recommend = document.getElementById("recommend");
			var price = document.getElementById("price");
			var position = document.getElementById("position");
			var filter = document.getElementById("filter");
			var flag = 0;
			var flagval=1;
			
			mui('#optionul').on('tap', '.option-item', function(e){
				console.log(this);
				var id=this.getAttribute("data-id")
				if(id==4&&flagval==1){
					mui('.filter-box')[0].style.display = "block";
					mui('.price-box')[0].style.display = "none";
					mui('.recommend-box')[0].style.display = "none";
					flagval=0;
				} else if(id==2){
					mui('.price-box')[0].style.display = "block";
					mui('.filter-box')[0].style.display = "none";
					mui('.recommend-box')[0].style.display = "none";
					flagval=1
				} else if(id==1){
					mui('.recommend-box')[0].style.display = "block";
					mui('.filter-box')[0].style.display = "none";
					mui('.price-box')[0].style.display = "none";
					flagval=1
				}
			});
			
			recommend.addEventListener('tap', function() {
				if(flag == 0) {
					mui('.recommend-box')[0].style.display = "block";
					flag = 1;
				} else {
					mui('.recommend-box')[0].style.display = "none";
					flag = 0;
				}
			});
			
			price.addEventListener('tap', function() {
				if(flag == 0) {
					mui('.price-box')[0].style.display = "block";
					flag = 1;
				} else {
					mui('.price-box')[0].style.display = "none";
					flag = 0;
				}
			});
			
			position.addEventListener('tap', function() {
				if(flag == 0) {
					mui('.position-box')[0].style.display = "block";
					flag = 1;
				} else {
					mui('.position-box')[0].style.display = "none";
					flag = 0;
				}
			});
			
			filter.addEventListener('tap', function() {
				if(flag == 0) {
					mui('.filter-box')[0].style.display = "block";
					flag = 1;
				} else {
					mui('.filter-box')[0].style.display = "none";
					flag = 0;
				}
			});
			
			mui.plusReady(function() {
				mui.ajax('www.aiai.com/api/hotellist', {
					dataType: 'json', //服务器返回json格式数据
					type: 'get', //HTTP请求类型
					success: function(data) {
						//获得服务器响应
						console.log(JSON.stringify(data))
					}
				});
			})
		</script>
	</body>

</html>